<template>
  <div id="box">
    <div id="form">
      <el-form label-position="left" :model="form">
        <el-form-item label="账号">
          <el-input v-model="form.sfUser" />
        </el-form-item>
        <el-form-item label="密码">
          <el-input v-model="form.sfPassword" />
        </el-form-item>
        <el-form-item label-width="25%">
          <el-button type="primary" @click="submitForm()">Submit</el-button>
          <el-button @click="resetForm()">Reset</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        sfUser: "zy",
        sfPassword: "123",
      },
    };
  },
  created() {},
  computed: {},
  methods: {
    submitForm() {
      this.$http
        .post(`http://127.0.0.1/staff/login`, this.form,)
        .then(({ data }) => {
          console.log(data);
          this.$router.push({ path: `/home` });
        });
    },
    resetForm() {},
  },
};
</script>
<style  scoped>
#box {
  width: 100%;
  height: 100%;
  background-image: url("../assets/img/Soar.jpg");
  /*背景是否重复*/
  background-repeat: no-repeat;
  /*背景大小:铺满*/
  background-size: cover;
  /*背景定位:中心    防止图片显示不全*/
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
#form {
  width: 360px;
  height: 260px;
  padding: 50px 50px;
  box-shadow: 0px 0px 5px darkorange;
  background-color: rgba(230, 204, 204, 0.5);
}
</style>